//导入express模块
const express = require('express');
//调用express模块
const app = express();
//使用 cors 中间件解决跨域
const cors = require('cors');
//导入文章路由模块
const articleRouter = require('./router/article');

//托管静态页面
app.use(express.static('../juejin'));
//全局注册cors中间件
app.use(cors());
//全局注册文章路由模块
app.use('/api',articleRouter);


//监听80端口
app.listen(8082,()=>{
    console.log('Service is running ...');
})